package com.yonyou.pmclouds.plan.rmiitf;

import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.plan.entity.PlanProgressHistoryVO;
import com.yonyou.pmclouds.plan.entity.PlanProgressVO;
import com.yonyou.pmclouds.plan.entity.ProjectPlanVO;
import com.yonyou.pmclouds.plan.entity.ProjectPlanViewVO;

import java.util.List;
import java.util.Map;

/**
 * 项目计划查询
 */
public interface ProjectPlanQuery {
    ProjectPlanVO[] queryPlanByProject(String projectId) throws BusinessException;

    ProjectPlanVO[] queryPlanByRoot(String rootId) throws BusinessException;

    ProjectPlanViewVO[] queryViewByRoot(String rootId) throws BusinessException;

    ProjectPlanVO queryPlanById(String planId) throws BusinessException;

    ProjectPlanVO queryPlanByIdWithPic(String planId) throws BusinessException;

    PlanProgressVO queryProgress(String planId);

    ProjectPlanVO[] queryLeafByRoot(String rootId) throws BusinessException;

    ProjectPlanViewVO[] queryViewByProject(String projectId) throws BusinessException;

    ProjectPlanViewVO[] queryViewLeafByRoot(String rootId) throws BusinessException;

    PlanProgressHistoryVO[] queryProgressHisByPlan(String planId) throws BusinessException;

    ProjectPlanViewVO[] queryPlanByTenantId(String tenantId) throws BusinessException;

    ProjectPlanViewVO[] queryLastViewByProject(String projectId) throws BusinessException;

    ProjectPlanViewVO[] queryHistoryView(String planId) throws BusinessException;

    Map<String, List<ProjectPlanViewVO> > queryLastViewByProjects(String[] projectIds) throws BusinessException;

    Map<String, Integer> getTotalProgress(String[] pkProjects) throws BusinessException;


    /**
     * 根据pkPlanwrite主键查询详细信息
     */
    ProjectPlanViewVO[] getPlanWriteById(String pkPlanWrite) throws BusinessException;

    ProjectPlanVO[] queryByProjectAndRelatedBillType(String pkProject, String billType, String transiType);

    PlanProgressVO[] queryProgressByPlans(String[] pkPlans);

    /**
     * 查询子计划
     *
     * @param pkParents
     * @return
     */
    Map<String, List<ProjectPlanVO>> queryChildPlanByParents(String[] pkParents);

    List<ProjectPlanVO> queryByPkPlans(String[] pkPlans);

    List<ProjectPlanVO> queryByProjectAndDependPlan(String pkProject, String[] dependPlans);

    ProjectPlanViewVO queryViewByPkPlan(String pkPlan) throws BusinessException;

    ProjectPlanViewVO[] queryMilltStonePlanByPkProject(String pkProject,String pkPlan) throws BusinessException;
}
